package com.mzy.linear_struct.subject;

import javax.sound.midi.Soundbank;

/**
 * @Author: codermzy
 * @Date: 2024/04/22/下午3:48
 * @Description:
 */
public class 只出现一次的数字136 {

    static class Solution {
         public int singleNumber(int[] nums) {
             int answer = nums[0];
             for (int i = 1; i < nums.length; i++) {
                 answer ^= nums[i];
             }

             return answer;
         }
     }


    public static void main(String[] args) {
        int[] nums = {1, 2, 2, 3, 3};
        int i = new Solution().singleNumber(nums);
        System.out.println(i);
    }
}
